#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
iOS崩溃堆栈解析工具

用于批量解析iOS崩溃堆栈信息的工具，通过dSYM文件将崩溃堆栈转换为可读状态。
"""

import sys
import logging
from PyQt6.QtWidgets import QApplication
from gui import CrashParserGUI

# 配置日志系统
def setup_logging():
    """设置日志系统"""
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
        handlers=[
            logging.FileHandler("crashparser.log", encoding='utf-8'),
            logging.StreamHandler()
        ]
    )
    
    # 设置第三方库的日志级别
    logging.getLogger("chardet").setLevel(logging.WARNING)
    logging.getLogger("pandas").setLevel(logging.WARNING)

def main():
    """主函数入口点"""
    # 设置日志
    setup_logging()
    
    # 创建应用
    app = QApplication(sys.argv)
    
    # 创建主窗口
    window = CrashParserGUI()
    window.show()
    
    # 启动应用主循环
    sys.exit(app.exec())

if __name__ == "__main__":
    main() 